<?php


namespace Part25_ResponsibilityChainModel\Code2;

/**
 * 联合国安全理事会会，相当于concreteMediator
 */
class UnitedNationSecurityCouncil extends UnitedNations
{
    /**
     * @var USA
     */
    private $colleague1;
    /**
     * @var Iraq
     */
    private $colleague2;

    /**
     * @param $value USA
     */
    public function setColleague1(USA $value)
    {
        $this->colleague1 = $value;
    }

    /**
     * @param $value Iraq
     */
    public function setColleague2(Iraq $value)
    {
        $this->colleague2 = $value;
    }

    public function declare($message, $colleague)
    {
        if ($colleague == $this->colleague1) {
            $this->colleague2->getMessage($message);
        } else {
            $this->colleague1->getMessage($message);
        }
    }
}